﻿<%@ Page Language="C#" AutoEventWireup="true" EnableViewState="false" CodeBehind="list.aspx.cs"
    Inherits="Forum.Web.Admin.KeyWord.list" %>

<%@ Register Assembly="Public.Control" Namespace="Public.Control" TagPrefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <link href="../styles/dntmanager.css" rel="stylesheet" type="text/css" />
    <link href="../styles/page2.css" rel="stylesheet" type="text/css" />
    <link href="../styles/modelpopup.css" rel="stylesheet" type="text/css" />
    <style>
        .ckall
        {
            display: block;
            height: 21px;
            padding-top: 9px;
            cursor: pointer;
        }
        #apDiv1
        {
            width: 360px;
            height: 278px;
            border: 2px solid #CCCCCC;
            background-color: #FFFFFF;
            display: inline;
        }
        .tu_title
        {
            text-align: center;
            background-color: #f1f1f1;
            font-weight: bold;
        }
        .tu_content
        {
            height: 255px;
            text-align: center;
            line-height: 255px;
        }
        .tu_content img
        {
            padding: 2px;
            border: 1px solid #CCCCCC;
            margin-top: 6%;
        }
        .index_bk_01
        {
            border: 1px solid #CCCCCC;
            height: 22px;
            line-height: 22px;
        }
        .keywrod
        {
            border: 1px #ffffff;
        }
    </style>
</head>

<script src="../js/public.js" type="text/javascript"></script>

<script src="../js/modalpopup.js" type="text/javascript"></script>

   <script src="../js/jquery/jquery.js" type="text/javascript"></script>

<body>
    <form id="form1" runat="server">
    <div class="ManagerForm">
        <fieldset>
            <legend style="background: url(../images/icons/icon10.jpg) no-repeat 6px 50%;">采集内容列表</legend>
            <div class="MainDiv">
                <table width="100%" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                        <td height="40px;">
                            &nbsp; 所属关键字:
                            <select id="f_mululist0" runat="server" onchange="showifr(this.value);" style="width: 150px;">
                                <option value="0">==分部==</option>
                            </select>
                        </td>
                        <td width="200" style="display: ;">
                            <input name="textfield" type="text" id="textfield" runat="server" class="index_bk_01"
                                style="width: 120px;">
                            <input name="button" type="button" class="index_bk_01" id="button" value="搜  索" onclick="showurl();"
                                style="background-color: White;">
                        </td>
                        <td>
                            &nbsp;
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>

                    <script type="text/javascript">
                        function showifr(mid) {
                            showurl();

                            //hbctl_.$("ifr").src="NewsList2.aspx?mid="+mid+"&k="+hbctl_.GetRound();
                        }
                        function showurl() {
                            var mid_ = hbctl_.GetValueOrTextBySelectID("f_mululist0", "value");

                            var tf_key = hbctl_.$("textfield").value; //推荐


                            var url = "list.aspx?mid=" + mid_ + "&k=" + hbctl_.GetRound();
                            if (tf_key.length > 0 && tf_key != " ") {
                                url = url + "&tf_key=" + encodeURI(tf_key);
                            }

                            window.location = url;
                        }
                        function showm(mid) {
                            hbctl_.SetValueByID("f_mululist0", mid);
                            showurl();
                        }
                    </script>

                </table>
                <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#EAE9E1">
                    <tr bgcolor="#F2F2F2">
                        <td height="2" colspan="5" bgcolor="#CCCCCC">
                        </td>
                    </tr>
                    <tr bgcolor="#F2F2F2">
                        <td width="50" height="35">
                            <strong>
                                <input type="checkbox" name="checkbox" id="checkbox" onclick="sall(this);" />
                                <label for="checkbox" style="padding: 0px; margin: 0px;">
                                    全选</label>
                            </strong>
                        </td>
                        <td height="35">
                            <strong>&nbsp;名称</strong>
                        </td>
                        <td align="center" width="250">
                            <strong>关键字</strong>
                        </td>
                        <td width="120" align="center" bgcolor="#F2F2F2">
                            <strong>添加日期</strong>
                        </td>
                        <td width="120" align="center">
                            <strong>入 库</strong>
                        </td>
                        <td width="70" align="center">
                            <strong>管理操作</strong>
                        </td>
                    </tr>
                    <asp:Repeater ID="Repeater1" runat="server">
                        <ItemTemplate>
                            <tr id="listkwc_<%#Eval("KWC_ID") %>">
                                <td height="30" bgcolor="#FFFFFF" align="center">
                                    <label for="Checkbox_list_<%#Eval("KWC_ID") %>" class="ckall">
                                        <input g='list' id="Checkbox_list_<%#Eval("KWC_ID") %>" value="<%#Eval("KWC_ID") %>"
                                            name="Checkbox_list" type="checkbox" /></label>
                                </td>
                                <td bgcolor="#FFFFFF" height="35">
                                    &nbsp;<a href="javascript:showm(<%#Eval("KWC_KWID") %>)">[<%#GetMuLuName(Eval("KWC_KWID"),0)%>]</a><a
                                        href="javascript:edit(<%#Eval("KWC_ID") %>)"><%#Eval("KWC_Name").ToString().Length > 30 ? Eval("KWC_Name").ToString().Substring(0, 28) + "..." : Eval("KWC_Name")%></a>
                                </td>
                                <td bgcolor="#FFFFFF" align="center">
                                    <input class="keywrod" value="<%#GetMuLuName(Eval("KWC_KWID"),1)%>" />
                                </td>
                                <td align="center" bgcolor="#FFFFFF">
                                    <%#Eval("KWC_AddTime")%>
                                </td>
                                <td align="center" bgcolor="#FFFFFF">
                                    <button type="button" class="ManagerButton" id="Button2" onclick="showdata(<%#Eval("KWC_ID") %>)">
                                        <img src="../images/topictype.gif" />转入库中</button>
                                </td>
                                <td align="center" bgcolor="#FFFFFF">
                                    <a href="javascript:edit(<%#Eval("KWC_ID") %>)">
                                        <img alt="编辑此信息" src="../images/icon_edit.gif" /></a> &nbsp;&nbsp;&nbsp; <a href="javascript:del_date(<%#Eval("KWC_ID") %>)">
                                            <img alt="删除此信息" src="../images/icon_del.gif" /></a>
                                </td>
                            </tr>
                        </ItemTemplate>
                    </asp:Repeater>
                </table>
            </div>
            <br />
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td height="30">
                        <button type="button" class="ManagerButton" id="Button2" onclick="dels()">
                            <img src="../images/del.gif" />删除选择项</button>
                    </td>
                </tr>
                <tr>
                    <td height="30" align="right">
                        <asp:Label ID="Label1" runat="server"></asp:Label>
                    </td>
                </tr>
            </table>
        </fieldset>
        <div class="Navbutton" style="display: none;">
        </div>
    </div>

    <script type="text/javascript">
        function showdata(myid) {
            Forum.Web.Admin.KeyWord.list.addrk(myid, function(res) {
                if (res && res.value) {
                    //alert("已经入库");
                    window.location.reload();
                }
            });
        }

        function del_data(myid) {
            Forum.Web.Admin.KeyWord.list.Del(myid, function(res) {
                if (res && res.value) {
                    if (res.value == 1) {
                        //alert("操作成功");
                        //window.location.reload();

                        hbctl_.$("listkwc_" + myid).style.display = "none";
                    }
                }
            });
        }

        function del_date(myid) {
            var tf_tf = window.confirm('您确定要删除选择的信息?');
            if (tf_tf) {
                del_data(myid);
            }
        }

        function edit(myid) {
            id_ = myid;
            var url = "edit.aspx?k=" + hbctl_.GetRound() + "&id=" + myid;
            hbctl_.$("ifr_edit").src = url;

            BOX_show("neworedit");
        }

        function hide(myid) {
            try {
                hbctl_.$("listkwc_" + myid).style.display = "none";

                hbctl_.$("ifr_edit").src = "../main/load.html";
                BOX_remove("neworedit");
            }
            catch (e) { }
        }

        function sall(this_) {
            hbctl_.CheckBoxAllByName("Checkbox_list", this_.checked);
        }

        function dels() {
            var stf = false;
            $("input[g='list']").each(function(i) {
                if ($(this).attr("checked")) {
                    stf = true;
                    return false;
                }
            });

            if (stf) {
                var tf_tf = window.confirm('您确定要删除选择的信息?');
                if (tf_tf) {
                    $("input[g='list']").each(function(i) {
                        if ($(this).attr("checked")) {
                            del_data($(this).attr("value"));
                        }
                    });
                }
            }
            else {
                alert("请选择要删除的信息");
            }
        }
    </script>

    <div id="neworedit" style="border-right: #999 1px solid; padding-right: 10px; border-top: #999 1px solid;
        display: none; padding-left: 10px; background: #fff; padding-bottom: 10px; border-left: #999 1px solid;
        width: 800px; padding-top: 10px; border-bottom: #999 1px solid">
        <div class="ManagerForm">
            <fieldset>
                <legend style="background: url(../images/icons/icon4.jpg) no-repeat 6px 50%">编辑内容</legend>
                <div>
                    <table width="740" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td height="550" valign="top">
                                <iframe id="ifr_edit" frameborder="0" scrolling="no" width="100%" height="550" src="../main/load.html">
                                </iframe>
                            </td>
                        </tr>
                    </table>
                </div>
            </fieldset>
        </div>
    </div>
    </form>
</body>
</html>
